<?php  ?>

<script>
	function viewLaporan(id){
		var url = "<?= base_url(); ?>laporan_penjualan_daging/laporan_titik_penjualan/"+id;
		var win = window.open(url, '_blank');
		win.focus();
	}
</script>

<div class="row-fluid sortable ui-sortable">
	<div id="gchart-daging-sapi-laporan" class="box span12">
		<div class="box-header well" data-original-title>
			<h2 id="action-title">Laporan Per Titik Penjualan</h2>
		</div>
		<div class="box-content">
			<div id="chart-daging-sapi-laporan">
				<table class="table table-striped table-bordered bootstrap-datatable datatable">
							  <thead>
								  <tr>
									  <th>Nama</th>
									  <th>Kota</th>
									  <th>Provinsi</th>
									  <th>Rata Penjualan</th>
									  <th>Action</th>
								  </tr>
							  </thead>   
							  <tbody>
								<?php if($all_stok_titik_penjualan != null): ?>
								
									<?php foreach($all_stok_titik_penjualan->result_array() as $row): ?>
										<tr>
											<td><?= $row['NAMA']; ?></td>
											<td><?= $row['NAMA_KOTA']; ?></td>
											<td><?= $row['NAMA_PROV']; ?></td>
											<td><?= $row['PERMINTAAN_NORMAL']; ?></td>
											<td class="center">
												<a class="btn btn-success" title="Buat Laporan" onclick="viewLaporan(<?= $row['ID_TITIK_PASOK']; ?>);">
													<i class="icon-zoom-in icon-white"></i>                                   
												</a>
											</td>
										</tr>
									<?php endforeach; ?>
								
								<?php endif; ?>
							</tbody>
						  </table>  
			</div>
		</div>
	</div>
</div>
